import { HttpServer } from "../utils/request";

// 获取个人信息
export const Async_userInfo = <T>(data) => {
    if (data.inviteCode) {
        return HttpServer<T>(`/user/info?inviteCode=${data.inviteCode}`, {}, "get");
    } else {
        return HttpServer<T>(`/user/info`, {}, "get");
    }
};

// 获取被推荐列表
export const Async_userRecommend = <T>(data) => {
    return HttpServer<T>(`/user/recommend?page=${data.page}&size=${data.size}`, {}, "get");
};

// 获取已邀请有效人数
export const Async_userRecommendNum = <T>() => {
    return HttpServer<T>(`/user/recommendNum`, {}, "get");
};

// 获取用户收益总量
export const Async_cashAll = <T>() => {
    return HttpServer<T>(`/cash/all`, {}, "get");
};

// 获取质押BT2记录
export const Async_lendRecordList = <T>(data) => {
    return HttpServer<T>(`/lend/recordList?type=${data.type}&page=${data.page}&size=${data.size}`, {}, "get");
};

// 我的团队
export const Async_userMyTeam = <T>() => {
    return HttpServer<T>(`/user/myTeam`, {}, "get");
};

// 资金变动记录
export const Async_cashList = <T>(data) => {
    return HttpServer<T>(`/cash/list?page=${data.page}&size=${data.size}&type=${data.type}`, {}, "get");
};

// 我的资产
export const Async_userMyWallet = <T>() => {
    return HttpServer<T>(`/user/myWallet`, {}, "get");
};

// 提币
export const Async_inoutWithdraw = <T>(data) => {
    return HttpServer<T>(`/inout/withdraw`, data, "post");
};

// 赎回
export const Async_lendRedemption = <T>(data) => {
    return HttpServer<T>(`/lend/redemption`, data, "post");
};

// 获取类型和时间
export const Async_lendNum = <T>() => {
    return HttpServer<T>(`/lend/num`, {}, "get");
}; 

// 提现记录
export const Async_inoutWithdrawList = <T>(data) => {
    return HttpServer<T>(`/inout/withdrawList?page=${data.page}&size=${data.size}`, {}, "get");
};